package com.example.hw_calendar_DB;

public class ToDoItemData implements
		CalendarManager.CalendarComparable<ToDoItemData> {

	public String title;
	public int year;
	public int month;
	public int day;
	public String text;
	public String location;

	public ToDoItemData(String title, int year, int month, int day,
			String text, String location) {
		this.title = title;
		this.year = year;
		this.month = month - 1;
		this.day = day;
		this.text = text;
		this.location = location;
	}

	@Override
	public int compareDate(int year, int month, int day) {
		// TODO Auto-generated method stub
		return ((this.year - year) * 12 + (this.month - month)) * 31 + this.day
				- day;
	}

	@Override
	public int compareToUsingCalendar(ToDoItemData another) {
		// TODO Auto-generated method stub
		return ((this.year - another.year) * 12 + (this.month - another.month))
				* 31 + this.day - another.day;
	}

}
